const log4js = require('log4js');

log4js.configure({  
    appenders: {  
        fileout: { type: "file", filename: "fileout.log" }, 
        datafileout: {
            type: "dateFile", 
            filename: "./logs/cnblogs/all.log", 
            // pattern: ".yyyy-MM-dd",
            // maxLogSize: "102400"
        },
        consoleout: { type: "console" }, 
    }, 
    categories: {    
        default: { appenders: ["datafileout"], level: "debug" },   
        anything: { appenders: ["consoleout"], level: "debug" }
    }
});

const logger = log4js.getLogger();
logger.level = 'INFO';

module.exports = logger;